package com.imc.core.utils;

import org.springframework.stereotype.Component;

import java.util.Base64;

/**
*类描述：base64解密
*开发者：QY
*创建时间：2018/9/12 9:49
**/
public class BASE64Utils {
    public static byte[] decode(String encodedText){
        final Base64.Decoder decoder = Base64.getDecoder();
        return decoder.decode(encodedText);
    }

    public static String encode(byte[] data){
        final Base64.Encoder encoder = Base64.getEncoder();
        return encoder.encodeToString(data);
    }
}
